package ace.j2se.l2;


import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;

/**
 * @Title:IpServlet.java
 * @Package servlet
 * @Description:TODO
 * @Author Kevin Guan E-mail:gjybst@163.com
 * @date Jun 28, 201111:14:40 AM
 * @Version
 * 
 */

public class IpServlet extends HttpServlet {

	@Override
	public void service(ServletRequest request, ServletResponse response)
			throws ServletException, IOException {
		System.out.println("IpServlet service");
		String ip = IpUtils.getIpFromRequest((HttpServletRequest) request);
		request.setAttribute("ip", ip);
		request.getRequestDispatcher("ip.jsp").forward(request, response);
	}

}
